# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=py3-aiofiles
_pkgname=aiofiles
pkgver=24.1.0
pkgrel=0
pkgdesc="File support for asyncio"
url="https://github.com/Tinche/aiofiles"
arch="noarch"
license="Apache-2.0"
depends="python3"
makedepends="py3-gpep517 py3-hatchling py3-installer"
checkdepends="py3-pytest py3-pytest-asyncio"
subpackages="$pkgname-pyc"
source="$_pkgname-$pkgver.tar.gz::https://github.com/Tinche/aiofiles/archive/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
b9571f287d2577822fd013f6849fd8c9b92fafbc771f084e4a8cecb9ab659289bcb208e9f6b291534dec5af7dddc88dbe8d032e92a02a6f9e0a8a76a6b4969c0  aiofiles-24.1.0.tar.gz
"
